<?php

class tplFormask extends StudyBuddy\Template\Template
{
	/**
	 * Important: names of form fields
	 * must match the keys in this array
	 * for example 'title', 'body', 'tags'
	 * must be names of form fields
	 *
	 * @var array
	 */
	protected static $vars = array(
	'token' => '', //1
	'required' => 'required', //2
	'title' => '', //3
	'title_l' => 'Title', // 4
	'title_d' => 'Enter a descriptive title',
	'title_e' => '', // 6
	'title_c' => 'ask_title', // 7
	'qbody' => '', //8
	'qbody_e' => '', //9
	'tags' => '', //10
	'tags_l' => 'Tags', //11
	'tags_d' => 'At least one tag, max 5 tags separated by comma', //12
	'tags_e' => '', //13
	'submit' => 'Submit', //14
	'com_hand' => '', // 15
	'readonly' => '', // 16
	'disabled' => '', // 17
	'connectBlock' => '', //18
	'formError' => '', //19
	'tags_required' => '', //20
	'socials' => '', //21
	'Preview' => 'Preview', // 22
	'subject' => '', // 23
	'subject_l' => 'Subject', // 24
	'level' => '', // 25
	'level_l' => 'Level', // 26
	'chapter' => '', // 27
	'chapter_l' => 'Chapter', // 28
	'dif' => '', // 29
	'dif_l' => 'Difficult' // 30
	); 

	protected static $tpl = '
<script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        relative_urls : false,
        width : "594",
        height : "300",
        object_resizing : false,
        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,jbimages,searchreplace,print,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
//        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

        // Theme options
        theme_advanced_buttons1 : "equation,jbimages",
//        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,cleanup,|,equation,|,image",
//        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "",
//        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "",
//        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,equation,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "",
//        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
//        theme_advanced_statusbar_location : "bottom",
        theme_advanced_statusbar_location : false,
        theme_advanced_resizing : false,

        file_browser_callback : "ajaxfilemanager",

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Style formats
        style_formats : [
            {title : "Bold text", inline : "b"},
            {title : "Red text", inline : "span", styles : {color : "#ff0000"}},
            {title : "Red header", block : "h1", styles : {color : "#ff0000"}},
            {title : "Example 1", inline : "span", classes : "example1"},
            {title : "Example 2", inline : "span", classes : "example2"},
            {title : "Table styles"},
            {title : "Table row 1", selector : "tr", classes : "tablerow1"}
        ],

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        },

        custom_elements: "m",
        extended_valid_elements: "m"
    });
</script>
<div class="ask-tit">
    Ask a question
</div>
<div>
    <form class="qa_form" name="qaForm" method="POST" action="/index.php" accept-charset="utf-8">
        <input type="hidden" name="a" value="ask">	
        <input type="hidden" name="token" value="%1$s">
        <div class="ask-tag">
            <div class="atag-left">%4$s :</div>
            <div class="atag-mid">
                <input autocomplete="off" id="id_title" class="title_c%15$s atag-txt" type="text" name="title" size="80" value="%3$s" %16$s>
                <div><span class="f_err cb" id="title_e">%6$s</span></div>
            </div>
        </div>
        <!-- start editor -->
        <div class="ask-tag" style="overflow:hidden">
            <textarea id="id_qbody" rows="6" cols="40" class="com_body%15$s" name="qbody" %16$s>%8$s</textarea>
            <div><span class="f_err fl cb" id="qbody_e">%9$s</span></div>
        </div>
        <!-- end editor -->

        <div class="ctl-nav">
            <div class="ctl-nav-ct" style="position:relative">	                            
                <select name="level" onchange="oSL.getSubject(this.options[this.selectedIndex].value)" style="border:none; background:#ff8e33; padding:0 3px 3px 0; width:86px; position:relative">
                    <option value="1">All Sec</option>
                    %25$s
                </select>
                <span style="position:absolute; float:right; bottom:0; right:0; width:24px; height:24px; background-color:#ff8e33"></span>
            </div>
            <div class="ctl-nav-solid">
                <img alt="" src="/images/2/icon/solid.gif" />
            </div>
            <div class="ctl-nav-ct">	   
                <div id="subject_container" style="position:relative">
                    <select name="subject" onchange="oSL.getChapter(this.options[this.selectedIndex].value)" style="border:none; background:#ff8e33; padding:0 3px 3px 0; width:86px; position:relative">
                        <option value="">All Subject</option>
                        %23$s
                    </select>
                    <span style="position:absolute; float:right; bottom:0; right:0; width:24px; height:24px; background-color:#ff8e33"></span>
                </div>
            </div>
            <div class="ctl-nav-solid">
                <img alt="" src="/images/2/icon/solid.gif" />
            </div>
            <div class="ctl-nav-ct">	                            
                <div id="chapter_container" style="position:relative">
                    <select name="chapter" style="border:none; background:#ff8e33; padding:0 3px 3px 0; width:86px; position:relative">
                        <option value="">All Chapter</option>
                        %27$s
                    </select>
                    <span style="position:absolute; float:right; bottom:0; right:0; width:24px; height:24px; background-color:#ff8e33"></span>
                </div>
            </div>
            %29$s
        </div>
        <div class="ask-tag" id="id_ask-tag">
            <div class="atag-left">%11$s :</div>
            <div class="atag-mid">
                <input id="id_tags" type="text" name="tags" class="tags_c%15$s atag-txt" size="80" value="%10$s" %16$s>  
                <div style="float:right"></div>
            </div>
            <div class="atag-right">
                <input id="dostuff" name="submit" type="submit" class="ask-btn" value="" %17$s style="border:none; background-color:transparent" />
            </div>
        </div>
        <div style="padding-left:77px"><span class="f_err fl cb"  id="tags_e">%13$s</span></div>
    </form>
</div>
<div class="ask-solid"></div>
<div class="ask-bot">
    Praesent convallis rhoncus placerat. Suspendisse tellus nisi, sollicitudin sed auctor id, luctus vel massa. Fusce at velit vel lectus vehicula dignissim a sit amet ante. Integer laoreet arcu sit amet ante rhoncus non cursus mauris laoreet. Aliquam volutpat consequat turpis sit amet semper. Integer dui erat, fermentum vel tincidunt vitae, gravida et nisi. Vestibulum sit amet nibh ligula.
</div>';
}

//            <div class="ctl-nav-solid">
//                <img alt="" src="/images/2/icon/solid.gif" />
//            </div>
//            <div class="ctl-nav-ct" style="position:relative">	                            
//                <select name="dif" style="border:none; background:transparent; padding:0 3px 3px 0; width:86px; position:relative">
//                    <option value="">%30$s</option>
//                    %29$s
//                </select>
//                <span style="position:absolute; float:right; bottom:0; right:0; width:24px; height:24px; background-color:#ff8e33"></span>
//            </div>